package com.aaa.controller;

import com.aaa.entity.Dept;
import com.aaa.entity.User;
import com.aaa.service.DeptService;
import com.aaa.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsPackage: com.aaa.controller
 * @Description:
 * @CreateTime: 2023-03-29  20:05
 * @Author: ql
 */
@RestController
@RequestMapping("/system/dept/")
public class DeptController {
    @Autowired
    private DeptService deptService;
    @GetMapping("/initDept")
    public Result<List<Dept>> initDept(){
        return deptService.findAll();
    }

    @GetMapping("/getDept/{id}")
    public Dept getDeptById(@PathVariable Integer id){
        return  deptService.getDeptById(id);
    }
}
